<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">

<html><head><title>MY_Model - Bonfire</title><link rel="stylesheet" type="text/css" href="../../styles/main.css"><script language=JavaScript src="../../javascript/main.js"></script><script language=JavaScript src="../../javascript/prettify.js"></script><script language=JavaScript src="../../javascript/searchdata.js"></script></head><body class="ContentPage" onLoad="NDOnLoad();prettyPrint();"><script language=JavaScript><!--
if (browserType) {document.write("<div class=" + browserType + ">");if (browserVer) {document.write("<div class=" + browserVer + ">"); }}// --></script>

<!--  Generated by Natural Docs, version 1.5 -->
<!--  http://www.naturaldocs.org  -->

<!-- saved from url=(0026)http://www.naturaldocs.org -->




<div id=Content><div class="CClass"><div class=CTopic id=MainTopic><h1 class=CTitle><a name="MY_Model"></a>MY_Model</h1><div class=CBody><p>The Base model implements standard CRUD functions that can be used and overriden by module models.&nbsp; This helps to maintain a standard interface to program to, and makes module creation faster.</p><h4 class=CHeading>Author</h4><p>Lonnie Ezell</p><!--START_ND_SUMMARY--><div class=Summary><div class=STitle>Summary</div><div class=SBorder><table border=0 cellspacing=0 cellpadding=0 class=STable><tr class="SMain"><td class=SEntry><a href="#MY_Model" >MY_Model</a></td><td class=SDescription>The Base model implements standard CRUD functions that can be used and overriden by module models. </td></tr><tr class="SGroup SIndent1"><td class=SEntry><a href="#MY_Model.Variables" >Variables</a></td><td class=SDescription></td></tr><tr class="SVariable SIndent2 SMarked"><td class=SEntry><a href="#MY_Model.$error" id=link1 onMouseOver="ShowTip(event, 'tt1', 'link1')" onMouseOut="HideTip('tt1')">$error</a></td><td class=SDescription>Stores custom errors that can be used in UI error reporting.</td></tr><tr class="SVariable SIndent2"><td class=SEntry><a href="#MY_Model.$table" id=link2 onMouseOver="ShowTip(event, 'tt2', 'link2')" onMouseOut="HideTip('tt2')">$table</a></td><td class=SDescription>The name of the db table this model primarily uses.</td></tr><tr class="SVariable SIndent2 SMarked"><td class=SEntry><a href="#MY_Model.$key" id=link3 onMouseOver="ShowTip(event, 'tt3', 'link3')" onMouseOut="HideTip('tt3')">$key</a></td><td class=SDescription>The primary key of the table. </td></tr><tr class="SVariable SIndent2"><td class=SEntry><a href="#MY_Model.$set_created" id=link4 onMouseOver="ShowTip(event, 'tt4', 'link4')" onMouseOut="HideTip('tt4')">$set_created</a></td><td class=SDescription>Whether or not to auto-fill a &lsquo;created_on&rsquo; field on inserts.</td></tr><tr class="SVariable SIndent2 SMarked"><td class=SEntry><a href="#MY_Model.$set_modified" id=link5 onMouseOver="ShowTip(event, 'tt5', 'link5')" onMouseOut="HideTip('tt5')">$set_modified</a></td><td class=SDescription>Whether or not to auto-fill a &lsquo;modified_on&rsquo; field on updates.</td></tr><tr class="SVariable SIndent2"><td class=SEntry><a href="#MY_Model.$date_format" id=link6 onMouseOver="ShowTip(event, 'tt6', 'link6')" onMouseOut="HideTip('tt6')">$date_format</a></td><td class=SDescription>The type of date/time field used for created_on and modified_on fields. </td></tr><tr class="SVariable SIndent2 SMarked"><td class=SEntry><a href="#MY_Model.$soft_deletes" id=link7 onMouseOver="ShowTip(event, 'tt7', 'link7')" onMouseOut="HideTip('tt7')">$soft_deletes</a></td><td class=SDescription>If false, the delete() method will perform a true delete of that row. </td></tr><tr class="SGroup SIndent1"><td class=SEntry><a href="#MY_Model.Functions" >Functions</a></td><td class=SDescription></td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#MY_Model.find" id=link8 onMouseOver="ShowTip(event, 'tt8', 'link8')" onMouseOut="HideTip('tt8')">find()</a></td><td class=SDescription>Searches for a single row in the database.</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#MY_Model.find_all" id=link9 onMouseOver="ShowTip(event, 'tt9', 'link9')" onMouseOut="HideTip('tt9')">find_all()</a></td><td class=SDescription>Returns all records in the table.</td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#MY_Model.find_all_by" id=link10 onMouseOver="ShowTip(event, 'tt10', 'link10')" onMouseOut="HideTip('tt10')">find_all_by()</a></td><td class=SDescription>A convenience method that combines a where() and find_all() call into a single call.</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#MY_Model.find_by" id=link11 onMouseOver="ShowTip(event, 'tt11', 'link11')" onMouseOut="HideTip('tt11')">find_by()</a></td><td class=SDescription>Returns the first result that matches the field/values passed.</td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#MY_Model.insert" id=link12 onMouseOver="ShowTip(event, 'tt12', 'link12')" onMouseOut="HideTip('tt12')">insert()</a></td><td class=SDescription>Inserts a row of data into the database.</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#MY_Model.update" id=link13 onMouseOver="ShowTip(event, 'tt13', 'link13')" onMouseOut="HideTip('tt13')">update()</a></td><td class=SDescription>Updates an existing row in the database.</td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#MY_Model.update_where" id=link14 onMouseOver="ShowTip(event, 'tt14', 'link14')" onMouseOut="HideTip('tt14')">update_where()</a></td><td class=SDescription>A convenience method that allows you to use any field/value pair as the &lsquo;where&rsquo; portion of your update.</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#MY_Model.delete" id=link15 onMouseOver="ShowTip(event, 'tt15', 'link15')" onMouseOut="HideTip('tt15')">delete()</a></td><td class=SDescription>Performs a delete on the record specified. </td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#MY_Model.is_unique" id=link16 onMouseOver="ShowTip(event, 'tt16', 'link16')" onMouseOut="HideTip('tt16')">is_unique()</a></td><td class=SDescription>Checks whether a field/value pair exists within the table.</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#MY_Model.count_all" id=link17 onMouseOver="ShowTip(event, 'tt17', 'link17')" onMouseOut="HideTip('tt17')">count_all()</a></td><td class=SDescription>Returns the number of rows in the table.</td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#MY_Model.count_by" id=link18 onMouseOver="ShowTip(event, 'tt18', 'link18')" onMouseOut="HideTip('tt18')">count_by()</a></td><td class=SDescription>Returns the number of elements that match the field/value pair.</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#MY_Model.get_field" id=link19 onMouseOver="ShowTip(event, 'tt19', 'link19')" onMouseOut="HideTip('tt19')">get_field()</a></td><td class=SDescription>A convenience method to return only a single field of the specified row.</td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#MY_Model.where" id=link20 onMouseOver="ShowTip(event, 'tt20', 'link20')" onMouseOut="HideTip('tt20')">where()</a></td><td class=SDescription>Sets the where portion of the query in a chainable format.</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#MY_Model.select" id=link21 onMouseOver="ShowTip(event, 'tt21', 'link21')" onMouseOut="HideTip('tt21')">select()</a></td><td class=SDescription>Sets the select portion of the query in a chainable format.</td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#MY_Model.limit" id=link22 onMouseOver="ShowTip(event, 'tt22', 'link22')" onMouseOut="HideTip('tt22')">limit()</a></td><td class=SDescription>Sets the limit portion of the query in a chainable format.</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#MY_Model.order_by" id=link23 onMouseOver="ShowTip(event, 'tt23', 'link23')" onMouseOut="HideTip('tt23')">order_by()</a></td><td class=SDescription>Inserts a chainable order_by method from either a string or an array of field/order combinations. </td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#MY_Model._function_check" id=link24 onMouseOver="ShowTip(event, 'tt24', 'link24')" onMouseOut="HideTip('tt24')">_function_check()</a></td><td class=SDescription></td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#MY_Model.set_date" id=link25 onMouseOver="ShowTip(event, 'tt25', 'link25')" onMouseOut="HideTip('tt25')">set_date()</a></td><td class=SDescription>A utility function to allow child models to use the type of date/time format that they prefer. </td></tr></table></div></div><!--END_ND_SUMMARY--></div></div></div>

<div class="CGroup"><div class=CTopic><h3 class=CTitle><a name="MY_Model.Variables"></a>Variables</h3></div></div>

<div class="CVariable"><div class=CTopic><h3 class=CTitle><a name="MY_Model.$error"></a>$error</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td>public $error</td></tr></table></blockquote><p>Stores custom errors that can be used in UI error reporting.</p></div></div></div>

<div class="CVariable"><div class=CTopic><h3 class=CTitle><a name="MY_Model.$table"></a>$table</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td>protected $table</td></tr></table></blockquote><p>The name of the db table this model primarily uses.</p><h4 class=CHeading>Access</h4><p>Protected</p></div></div></div>

<div class="CVariable"><div class=CTopic><h3 class=CTitle><a name="MY_Model.$key"></a>$key</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td>protected $key</td></tr></table></blockquote><p>The primary key of the table.&nbsp; Used as the &lsquo;id&rsquo; throughout.</p><h4 class=CHeading>Access</h4><p>Protected</p></div></div></div>

<div class="CVariable"><div class=CTopic><h3 class=CTitle><a name="MY_Model.$set_created"></a>$set_created</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td>protected $set_created</td></tr></table></blockquote><p>Whether or not to auto-fill a &lsquo;created_on&rsquo; field on inserts.</p><h4 class=CHeading>Access</h4><p>Protected</p></div></div></div>

<div class="CVariable"><div class=CTopic><h3 class=CTitle><a name="MY_Model.$set_modified"></a>$set_modified</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td>protected $set_modified</td></tr></table></blockquote><p>Whether or not to auto-fill a &lsquo;modified_on&rsquo; field on updates.</p><h4 class=CHeading>Access</h4><p>Protected</p></div></div></div>

<div class="CVariable"><div class=CTopic><h3 class=CTitle><a name="MY_Model.$date_format"></a>$date_format</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td>protected $date_format</td></tr></table></blockquote><p>The type of date/time field used for created_on and modified_on fields.&nbsp; Valid types are: &lsquo;int&rsquo;, &lsquo;datetime&rsquo;, &lsquo;date&rsquo;</p><h4 class=CHeading>Access</h4><p>protected</p></div></div></div>

<div class="CVariable"><div class=CTopic><h3 class=CTitle><a name="MY_Model.$soft_deletes"></a>$soft_deletes</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td>protected $soft_deletes</td></tr></table></blockquote><p>If false, the delete() method will perform a true delete of that row.&nbsp; If true, a &lsquo;deleted&rsquo; field will be set to 1.</p><h4 class=CHeading>Access</h4><p>Protected</p></div></div></div>

<div class="CGroup"><div class=CTopic><h3 class=CTitle><a name="MY_Model.Functions"></a>Functions</h3></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="MY_Model.find"></a>find()</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>public function find(</td><td class=PParameter nowrap>$id</td><td class=PDefaultValuePrefix>&nbsp;=&nbsp;</td><td class=PDefaultValue width=100%>''</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Searches for a single row in the database.</p><h4 class=CHeading>Parameter</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>$id</td><td class=CDLDescription>The primary key of the record to search for.</td></tr></table><h4 class=CHeading>Return</h4><p>An object representing the db row, or false.</p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="MY_Model.find_all"></a>find_all()</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td>public function find_all()</td></tr></table></blockquote><p>Returns all records in the table.</p><p>By default, there is no &lsquo;where&rsquo; clause, but you can filter the results that are returned by using either CodeIgniter&rsquo;s Active Record functions before calling this function, or through method chaining with the where() method of this class.</p><h4 class=CHeading>Return</h4><p>An array of objects representing the results, or FALSE on failure or empty set.</p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="MY_Model.find_all_by"></a>find_all_by()</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>public function find_all_by(</td><td class=PParameter nowrap>$field</td><td class=PDefaultValuePrefix>&nbsp;=&nbsp;</td><td class=PDefaultValue width=100%>null,</td></tr><tr><td></td><td class=PParameter nowrap>$value</td><td class=PDefaultValuePrefix>&nbsp;=&nbsp;</td><td class=PDefaultValue width=100%>''</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>A convenience method that combines a where() and find_all() call into a single call.</p><h4 class=CHeading>Paremeters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>$field</td><td class=CDLDescription>The table field to search in.</td></tr><tr><td class=CDLEntry>$value</td><td class=CDLDescription>The value that field should be.</td></tr></table><h4 class=CHeading>Return</h4><p>An array of objects representing the results, or FALSE on failure or empty set.</p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="MY_Model.find_by"></a>find_by()</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>public function find_by(</td><td class=PParameter nowrap>$field</td><td class=PDefaultValuePrefix>&nbsp;=&nbsp;</td><td class=PDefaultValue width=100%>'',</td></tr><tr><td></td><td class=PParameter nowrap>$value</td><td class=PDefaultValuePrefix>&nbsp;=&nbsp;</td><td class=PDefaultValue width=100%>'',</td></tr><tr><td></td><td class=PParameter nowrap>$type</td><td class=PDefaultValuePrefix>&nbsp;=&nbsp;</td><td class=PDefaultValue width=100%>'and'</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Returns the first result that matches the field/values passed.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>$field</td><td class=CDLDescription>Either a string or an array of fields to match against.&nbsp; If an array is passed it, the $value parameter is ignored since the array is expected to have key/value pairs in it.</td></tr><tr><td class=CDLEntry>$value</td><td class=CDLDescription>The value to match on the $field.&nbsp; Only used when $field is a string.</td></tr><tr><td class=CDLEntry>$type</td><td class=CDLDescription>The type of where clause to create.&nbsp; Either &lsquo;and&rsquo; or &lsquo;or&rsquo;.</td></tr></table><h4 class=CHeading>Return</h4><p>An object representing the first result returned.</p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="MY_Model.insert"></a>insert()</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>public function insert(</td><td class=PParameter nowrap>$data</td><td class=PDefaultValuePrefix>&nbsp;=&nbsp;</td><td class=PDefaultValue width=100%>null</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Inserts a row of data into the database.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>$data</td><td class=CDLDescription>an array of key/value pairs to insert.</td></tr></table><h4 class=CHeading>Return</h4><p>Either the $id of the row inserted, or false on failure.</p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="MY_Model.update"></a>update()</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>public function update(</td><td class=PParameter nowrap>$id</td><td class=PDefaultValuePrefix>&nbsp;=&nbsp;</td><td class=PDefaultValue width=100%>null,</td></tr><tr><td></td><td class=PParameter nowrap>$data</td><td class=PDefaultValuePrefix>&nbsp;=&nbsp;</td><td class=PDefaultValue width=100%>null</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Updates an existing row in the database.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>$id</td><td class=CDLDescription>The primary_key value of the row to update.</td></tr><tr><td class=CDLEntry>$data</td><td class=CDLDescription>An array of key/value pairs to update.</td></tr></table><h4 class=CHeading>Return</h4><p>true/false</p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="MY_Model.update_where"></a>update_where()</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>public function update_where(</td><td class=PParameter nowrap>$field</td><td class=PDefaultValuePrefix>&nbsp;=&nbsp;</td><td class=PDefaultValue width=100%>null,</td></tr><tr><td></td><td class=PParameter nowrap>$value</td><td class=PDefaultValuePrefix>&nbsp;=&nbsp;</td><td class=PDefaultValue width=100%>null,</td></tr><tr><td></td><td class=PParameter nowrap>$data</td><td class=PDefaultValuePrefix>&nbsp;=&nbsp;</td><td class=PDefaultValue width=100%>null</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>A convenience method that allows you to use any field/value pair as the &lsquo;where&rsquo; portion of your update.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>$field</td><td class=CDLDescription>The field to match on.</td></tr><tr><td class=CDLEntry>$value</td><td class=CDLDescription>The value to search the $field for.</td></tr><tr><td class=CDLEntry>$data</td><td class=CDLDescription>An array of key/value pairs to update.</td></tr></table><h4 class=CHeading>Return</h4><p>true/false</p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="MY_Model.delete"></a>delete()</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>public function delete(</td><td class=PParameter nowrap>$id</td><td class=PDefaultValuePrefix>&nbsp;=&nbsp;</td><td class=PDefaultValue width=100%>null</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Performs a delete on the record specified.&nbsp; If $this-&gt;soft_deletes is TRUE, it will attempt to set a field &lsquo;deleted&rsquo; on the current record to &lsquo;1&rsquo;, to allow the data to remain in the database.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>$id</td><td class=CDLDescription>The primary_key value to match against.</td></tr></table><h4 class=CHeading>Return</h4><p>true/false</p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="MY_Model.is_unique"></a>is_unique()</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>public function is_unique(</td><td class=PParameter nowrap>$field</td><td class=PDefaultValuePrefix>&nbsp;=&nbsp;</td><td class=PDefaultValue width=100%>'',</td></tr><tr><td></td><td class=PParameter nowrap>$value</td><td class=PDefaultValuePrefix>&nbsp;=&nbsp;</td><td class=PDefaultValue width=100%>''</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Checks whether a field/value pair exists within the table.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>$field</td><td class=CDLDescription>The field to search for.</td></tr><tr><td class=CDLEntry>$value</td><td class=CDLDescription>The value to match $field against.</td></tr></table><h4 class=CHeading>Return</h4><p>true/false</p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="MY_Model.count_all"></a>count_all()</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td>public function count_all()</td></tr></table></blockquote><p>Returns the number of rows in the table.</p><h4 class=CHeading>Return</h4><p>int</p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="MY_Model.count_by"></a>count_by()</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>public function count_by(</td><td class=PParameter nowrap>$field</td><td class=PDefaultValuePrefix>&nbsp;=&nbsp;</td><td class=PDefaultValue width=100%>'',</td></tr><tr><td></td><td class=PParameter nowrap>$value</td><td class=PDefaultValuePrefix>&nbsp;=&nbsp;</td><td class=PDefaultValue width=100%>''</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Returns the number of elements that match the field/value pair.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>$field</td><td class=CDLDescription>The field to search for.</td></tr><tr><td class=CDLEntry>$value</td><td class=CDLDescription>The value to match $field against.</td></tr></table><h4 class=CHeading>Return</h4><p>int</p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="MY_Model.get_field"></a>get_field()</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>public function get_field(</td><td class=PParameter nowrap>$id</td><td class=PDefaultValuePrefix>&nbsp;=&nbsp;</td><td class=PDefaultValue width=100%>null,</td></tr><tr><td></td><td class=PParameter nowrap>$field</td><td class=PDefaultValuePrefix>&nbsp;=&nbsp;</td><td class=PDefaultValue width=100%>''</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>A convenience method to return only a single field of the specified row.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>$field</td><td class=CDLDescription>The field to search for.</td></tr><tr><td class=CDLEntry>$value</td><td class=CDLDescription>The value to match $field against.</td></tr></table><h4 class=CHeading>Return</h4><p>An object with the field value in it.</p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="MY_Model.where"></a>where()</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>public function where(</td><td class=PParameter nowrap>$field</td><td class=PDefaultValuePrefix>&nbsp;=&nbsp;</td><td class=PDefaultValue width=100%>null,</td></tr><tr><td></td><td class=PParameter nowrap>$value</td><td class=PDefaultValuePrefix>&nbsp;=&nbsp;</td><td class=PDefaultValue width=100%>null</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Sets the where portion of the query in a chainable format.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>$field</td><td class=CDLDescription>The field to search the db on.</td></tr><tr><td class=CDLEntry>$value</td><td class=CDLDescription>The value to match the field against.</td></tr></table><h4 class=CHeading>Return</h4><p>An instance of this class.</p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="MY_Model.select"></a>select()</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>public function select(</td><td class=PParameter nowrap>$selects</td><td class=PDefaultValuePrefix>&nbsp;=&nbsp;</td><td class=PDefaultValue width=100%>null</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Sets the select portion of the query in a chainable format.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>$selects</td><td class=CDLDescription>A string representing the selection.</td></tr></table><h4 class=CHeading>Return</h4><p>An instance of this class.</p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="MY_Model.limit"></a>limit()</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>public function limit(</td><td class=PParameter nowrap>$limit</td><td class=PDefaultValuePrefix>&nbsp;=&nbsp;</td><td class=PDefaultValue width=100%>0,</td></tr><tr><td></td><td class=PParameter nowrap>$offset</td><td class=PDefaultValuePrefix>&nbsp;=&nbsp;</td><td class=PDefaultValue width=100%>0</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Sets the limit portion of the query in a chainable format.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>$limit</td><td class=CDLDescription>An int showing the max results to return.</td></tr><tr><td class=CDLEntry>$offset</td><td class=CDLDescription>An in showing how far into the results to start returning info.</td></tr></table><h4 class=CHeading>Return</h4><p>An instance of this class.</p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="MY_Model.order_by"></a>order_by()</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>public function order_by(</td><td class=PParameter nowrap>$field</td><td class=PDefaultValuePrefix>&nbsp;=&nbsp;</td><td class=PDefaultValue width=100%>null,</td></tr><tr><td></td><td class=PParameter nowrap>$order</td><td class=PDefaultValuePrefix>&nbsp;=&nbsp;</td><td class=PDefaultValue width=100%>'asc'</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Inserts a chainable order_by method from either a string or an array of field/order combinations.&nbsp; If the $field value is an array, it should look like:</p><p>array( &lsquo;field1&rsquo; =&gt; &lsquo;asc&rsquo;, &lsquo;field2&rsquo; =&gt; &lsquo;desc&rsquo; );</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>$field</td><td class=CDLDescription>The field to order the results by.</td></tr><tr><td class=CDLEntry>$order</td><td class=CDLDescription>Which direction to order the results (&lsquo;asc&rsquo; or &lsquo;desc&rsquo;)</td></tr></table><h4 class=CHeading>Return</h4><p>An instance of this class.</p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="MY_Model._function_check"></a>_function_check()</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>protected function _function_check(</td><td class=PParameterPrefix nowrap></td><td class=PParameter nowrap>$id</td><td class=PDefaultValuePrefix>&nbsp;=&nbsp;</td><td class=PDefaultValue width=100%>FALSE,</td></tr><tr><td></td><td class=PParameterPrefix nowrap>&amp;</td><td class=PParameter nowrap>$data</td><td class=PDefaultValuePrefix>&nbsp;=&nbsp;</td><td class=PDefaultValue width=100%>FALSE</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><h4 class=CHeading>A utility method that does some error checking and cleanup for other methods</h4><ul><li>Makes sure that a table has been set at $this-&gt;table.</li><li>If passed in, will make sure that $id is of the valid type.</li><li>If passed in, will verify the $data is not empty.</li></ul></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="MY_Model.set_date"></a>set_date()</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>protected function set_date(</td><td class=PParameter nowrap>$user_date</td><td class=PDefaultValuePrefix>&nbsp;=&nbsp;</td><td class=PDefaultValue width=100%>null</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>A utility function to allow child models to use the type of date/time format that they prefer.&nbsp; This is primarily used for setting created_on and modified_on values, but can be used by inheriting classes.</p><h4 class=CHeading>The available time formats are</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>&rsquo;int&rsquo;</td><td class=CDLDescription>Stores the date as an integer timestamp.</td></tr><tr><td class=CDLEntry>&rsquo;datetime&rsquo;</td><td class=CDLDescription>Stores the date and time in the SQL datetime format.</td></tr><tr><td class=CDLEntry>&rsquo;date&rsquo;</td><td class=CDLDescription>Stores teh date (only) in the SQL date format.</td></tr></table><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>$user_date</td><td class=CDLDescription>An optional PHP timestamp to be converted.</td></tr></table><h4 class=CHeading>Return</h4><p>The current/user time converted to the proper format.</p></div></div></div>

</div><!--Content-->


<div id=Footer><a href="http://www.naturaldocs.org">Generated by Natural Docs</a></div><!--Footer-->


<div id=Menu><div class=MTitle>Bonfire<div class=MSubTitle>Faster CodeIgniter Development</div></div><div class=MEntry><div class=MGroup><a href="javascript:ToggleMenu('MGroupContent1')">Guides</a><div class=MGroupContent id=MGroupContent1><div class=MEntry><div class=MFile><a href="../../files2/installing-txt.html">Installing Bonfire</a></div></div><div class=MEntry><div class=MFile><a href="../../files2/modules/overview-txt.html">Modules Overview</a></div></div><div class=MEntry><div class=MFile><a href="../../files2/auth_notes-txt.html">Understanding Authentication</a></div></div></div></div></div><div class=MEntry><div class=MGroup><a href="javascript:ToggleMenu('MGroupContent2')">Helpers</a><div class=MGroupContent id=MGroupContent2><div class=MEntry><div class=MFile><a href="../helpers/address_helper-php.html">Address Helper</a></div></div><div class=MEntry><div class=MFile><a href="../helpers/application_helper-php.html">Application Helper</a></div></div><div class=MEntry><div class=MFile><a href="../helpers/config_file_helper-php.html">Config File Helper</a></div></div></div></div></div><div class=MEntry><div class=MGroup><a href="javascript:ToggleMenu('MGroupContent3')">Libraries</a><div class=MGroupContent id=MGroupContent3><div class=MEntry><div class=MFile><a href="../libraries/assets-php.html">Assets</a></div></div><div class=MEntry><div class=MFile><a href="../libraries/template-php.html">Template</a></div></div><div class=MEntry><div class=MFile><a href="../core_modules/users/libraries/auth-php.html">Auth</a></div></div><div class=MEntry><div class=MFile><a href="../libraries/Console-php.html">Console</a></div></div></div></div></div><div class=MEntry><div class=MGroup><a href="javascript:ToggleMenu('MGroupContent4')">Core Overrides</a><div class=MGroupContent id=MGroupContent4><div class=MEntry><div class=MFile><a href="MY_Controller-php.html">Controllers</a></div></div><div class=MEntry><div class=MFile id=MSelected>MY_Model</div></div></div></div></div><div class=MEntry><div class=MGroup><a href="javascript:ToggleMenu('MGroupContent5')">Core Modules</a><div class=MGroupContent id=MGroupContent5><div class=MEntry><div class=MFile><a href="../core_modules/emailer/libraries/emailer-php.html">Emailer</a></div></div><div class=MEntry><div class=MFile><a href="../core_modules/migrations/libraries/Migrations-php.html">Migrations</a></div></div><div class=MEntry><div class=MFile><a href="../core_modules/roles/models/permission_model-php.html">Permission_model</a></div></div><div class=MEntry><div class=MFile><a href="../core_modules/roles/models/role_model-php.html">Role_model</a></div></div></div></div></div><div class=MEntry><div class=MFile><a href="../controllers/install-php.html">controllers/<wbr>install.php</a></div></div><div class=MEntry><div class=MFile><a href="../core_modules/logs/controllers/developer-php.html">core_modules/.../controllers/<wbr>developer.php</a></div></div><div class=MEntry><div class=MGroup><a href="javascript:ToggleMenu('MGroupContent6')">Index</a><div class=MGroupContent id=MGroupContent6><div class=MEntry><div class=MIndex><a href="../../index/General.html">Everything</a></div></div><div class=MEntry><div class=MIndex><a href="../../index/Classes.html">Classes</a></div></div><div class=MEntry><div class=MIndex><a href="../../index/Functions.html">Functions</a></div></div><div class=MEntry><div class=MIndex><a href="../../index/Variables.html">Variables</a></div></div><div class=MEntry><div class=MIndex><a href="../../index/Files.html">Files</a></div></div></div></div></div><script type="text/javascript"><!--
var searchPanel = new SearchPanel("searchPanel", "HTML", "../../search");
--></script><div id=MSearchPanel class=MSearchPanelInactive><input type=text id=MSearchField value=Search onFocus="searchPanel.OnSearchFieldFocus(true)" onBlur="searchPanel.OnSearchFieldFocus(false)" onKeyUp="searchPanel.OnSearchFieldChange()"><select id=MSearchType onFocus="searchPanel.OnSearchTypeFocus(true)" onBlur="searchPanel.OnSearchTypeFocus(false)" onChange="searchPanel.OnSearchTypeChange()"><option  id=MSearchEverything selected value="General">Everything</option><option value="Classes">Classes</option><option value="Files">Files</option><option value="Functions">Functions</option><option value="Variables">Variables</option></select></div><script language=JavaScript><!--
HideAllBut([4, 5, 3, 6], 7);// --></script></div><!--Menu-->



<!--START_ND_TOOLTIPS-->
<div class=CToolTip id="tt1"><div class=CVariable><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td>public $error</td></tr></table></blockquote>Stores custom errors that can be used in UI error reporting.</div></div><div class=CToolTip id="tt2"><div class=CVariable><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td>protected $table</td></tr></table></blockquote>The name of the db table this model primarily uses.</div></div><div class=CToolTip id="tt3"><div class=CVariable><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td>protected $key</td></tr></table></blockquote>The primary key of the table. </div></div><div class=CToolTip id="tt4"><div class=CVariable><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td>protected $set_created</td></tr></table></blockquote>Whether or not to auto-fill a &lsquo;created_on&rsquo; field on inserts.</div></div><div class=CToolTip id="tt5"><div class=CVariable><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td>protected $set_modified</td></tr></table></blockquote>Whether or not to auto-fill a &lsquo;modified_on&rsquo; field on updates.</div></div><div class=CToolTip id="tt6"><div class=CVariable><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td>protected $date_format</td></tr></table></blockquote>The type of date/time field used for created_on and modified_on fields. </div></div><div class=CToolTip id="tt7"><div class=CVariable><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td>protected $soft_deletes</td></tr></table></blockquote>If false, the delete() method will perform a true delete of that row. </div></div><div class=CToolTip id="tt8"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>public function find(</td><td class=PParameter nowrap>$id</td><td class=PDefaultValuePrefix>&nbsp;=&nbsp;</td><td class=PDefaultValue width=100%>''</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Searches for a single row in the database.</div></div><div class=CToolTip id="tt9"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td>public function find_all()</td></tr></table></blockquote>Returns all records in the table.</div></div><div class=CToolTip id="tt10"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>public function find_all_by(</td><td class=PParameter nowrap>$field</td><td class=PDefaultValuePrefix>&nbsp;=&nbsp;</td><td class=PDefaultValue width=100%>null,</td></tr><tr><td></td><td class=PParameter nowrap>$value</td><td class=PDefaultValuePrefix>&nbsp;=&nbsp;</td><td class=PDefaultValue width=100%>''</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>A convenience method that combines a where() and find_all() call into a single call.</div></div><div class=CToolTip id="tt11"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>public function find_by(</td><td class=PParameter nowrap>$field</td><td class=PDefaultValuePrefix>&nbsp;=&nbsp;</td><td class=PDefaultValue width=100%>'',</td></tr><tr><td></td><td class=PParameter nowrap>$value</td><td class=PDefaultValuePrefix>&nbsp;=&nbsp;</td><td class=PDefaultValue width=100%>'',</td></tr><tr><td></td><td class=PParameter nowrap>$type</td><td class=PDefaultValuePrefix>&nbsp;=&nbsp;</td><td class=PDefaultValue width=100%>'and'</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Returns the first result that matches the field/values passed.</div></div><div class=CToolTip id="tt12"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>public function insert(</td><td class=PParameter nowrap>$data</td><td class=PDefaultValuePrefix>&nbsp;=&nbsp;</td><td class=PDefaultValue width=100%>null</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Inserts a row of data into the database.</div></div><div class=CToolTip id="tt13"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>public function update(</td><td class=PParameter nowrap>$id</td><td class=PDefaultValuePrefix>&nbsp;=&nbsp;</td><td class=PDefaultValue width=100%>null,</td></tr><tr><td></td><td class=PParameter nowrap>$data</td><td class=PDefaultValuePrefix>&nbsp;=&nbsp;</td><td class=PDefaultValue width=100%>null</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Updates an existing row in the database.</div></div><div class=CToolTip id="tt14"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>public function update_where(</td><td class=PParameter nowrap>$field</td><td class=PDefaultValuePrefix>&nbsp;=&nbsp;</td><td class=PDefaultValue width=100%>null,</td></tr><tr><td></td><td class=PParameter nowrap>$value</td><td class=PDefaultValuePrefix>&nbsp;=&nbsp;</td><td class=PDefaultValue width=100%>null,</td></tr><tr><td></td><td class=PParameter nowrap>$data</td><td class=PDefaultValuePrefix>&nbsp;=&nbsp;</td><td class=PDefaultValue width=100%>null</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>A convenience method that allows you to use any field/value pair as the &lsquo;where&rsquo; portion of your update.</div></div><div class=CToolTip id="tt15"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>public function delete(</td><td class=PParameter nowrap>$id</td><td class=PDefaultValuePrefix>&nbsp;=&nbsp;</td><td class=PDefaultValue width=100%>null</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Performs a delete on the record specified. </div></div><div class=CToolTip id="tt16"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>public function is_unique(</td><td class=PParameter nowrap>$field</td><td class=PDefaultValuePrefix>&nbsp;=&nbsp;</td><td class=PDefaultValue width=100%>'',</td></tr><tr><td></td><td class=PParameter nowrap>$value</td><td class=PDefaultValuePrefix>&nbsp;=&nbsp;</td><td class=PDefaultValue width=100%>''</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Checks whether a field/value pair exists within the table.</div></div><div class=CToolTip id="tt17"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td>public function count_all()</td></tr></table></blockquote>Returns the number of rows in the table.</div></div><div class=CToolTip id="tt18"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>public function count_by(</td><td class=PParameter nowrap>$field</td><td class=PDefaultValuePrefix>&nbsp;=&nbsp;</td><td class=PDefaultValue width=100%>'',</td></tr><tr><td></td><td class=PParameter nowrap>$value</td><td class=PDefaultValuePrefix>&nbsp;=&nbsp;</td><td class=PDefaultValue width=100%>''</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Returns the number of elements that match the field/value pair.</div></div><div class=CToolTip id="tt19"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>public function get_field(</td><td class=PParameter nowrap>$id</td><td class=PDefaultValuePrefix>&nbsp;=&nbsp;</td><td class=PDefaultValue width=100%>null,</td></tr><tr><td></td><td class=PParameter nowrap>$field</td><td class=PDefaultValuePrefix>&nbsp;=&nbsp;</td><td class=PDefaultValue width=100%>''</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>A convenience method to return only a single field of the specified row.</div></div><div class=CToolTip id="tt20"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>public function where(</td><td class=PParameter nowrap>$field</td><td class=PDefaultValuePrefix>&nbsp;=&nbsp;</td><td class=PDefaultValue width=100%>null,</td></tr><tr><td></td><td class=PParameter nowrap>$value</td><td class=PDefaultValuePrefix>&nbsp;=&nbsp;</td><td class=PDefaultValue width=100%>null</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Sets the where portion of the query in a chainable format.</div></div><div class=CToolTip id="tt21"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>public function select(</td><td class=PParameter nowrap>$selects</td><td class=PDefaultValuePrefix>&nbsp;=&nbsp;</td><td class=PDefaultValue width=100%>null</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Sets the select portion of the query in a chainable format.</div></div><div class=CToolTip id="tt22"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>public function limit(</td><td class=PParameter nowrap>$limit</td><td class=PDefaultValuePrefix>&nbsp;=&nbsp;</td><td class=PDefaultValue width=100%>0,</td></tr><tr><td></td><td class=PParameter nowrap>$offset</td><td class=PDefaultValuePrefix>&nbsp;=&nbsp;</td><td class=PDefaultValue width=100%>0</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Sets the limit portion of the query in a chainable format.</div></div><div class=CToolTip id="tt23"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>public function order_by(</td><td class=PParameter nowrap>$field</td><td class=PDefaultValuePrefix>&nbsp;=&nbsp;</td><td class=PDefaultValue width=100%>null,</td></tr><tr><td></td><td class=PParameter nowrap>$order</td><td class=PDefaultValuePrefix>&nbsp;=&nbsp;</td><td class=PDefaultValue width=100%>'asc'</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Inserts a chainable order_by method from either a string or an array of field/order combinations. </div></div><div class=CToolTip id="tt24"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>protected function _function_check(</td><td class=PParameterPrefix nowrap></td><td class=PParameter nowrap>$id</td><td class=PDefaultValuePrefix>&nbsp;=&nbsp;</td><td class=PDefaultValue width=100%>FALSE,</td></tr><tr><td></td><td class=PParameterPrefix nowrap>&amp;</td><td class=PParameter nowrap>$data</td><td class=PDefaultValuePrefix>&nbsp;=&nbsp;</td><td class=PDefaultValue width=100%>FALSE</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote></div></div><div class=CToolTip id="tt25"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>protected function set_date(</td><td class=PParameter nowrap>$user_date</td><td class=PDefaultValuePrefix>&nbsp;=&nbsp;</td><td class=PDefaultValue width=100%>null</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>A utility function to allow child models to use the type of date/time format that they prefer. </div></div><!--END_ND_TOOLTIPS-->




<div id=MSearchResultsWindow><iframe src="" frameborder=0 name=MSearchResults id=MSearchResults></iframe><a href="javascript:searchPanel.CloseResultsWindow()" id=MSearchResultsWindowClose>Close</a></div>


<script language=JavaScript><!--
if (browserType) {if (browserVer) {document.write("</div>"); }document.write("</div>");}// --></script></body></html>